#ifndef MESSAGELISTWIDGET_H
#define MESSAGELISTWIDGET_H

#include <QListWidget>
#include <QList>
#include <QVBoxLayout>
#include <QStyleOption>
#include <QPainter>
#include <QScrollArea>
#include <MessageWidget.h>

class MessageListWidget : public QWidget
{
    Q_OBJECT
private:
    QList<MessageWidget*> *widgetList;
    QVBoxLayout* layout;
    QScrollBar* scrollBar;

public:
    explicit MessageListWidget(QWidget *parent = 0);
    void setupUi();

    void add(MessageWidget* widget);

    int count();
    void removeAt(int i);
    void clear();
    MessageWidget* elementAt(int i);
    //void paintEvent(QPaintEvent *);

signals:
    
public slots:
    void add(QxPLMessage message);

};

#endif // MESSAGELISTWIDGET_H
